package com.uraurora.crescent.tuple;

import com.uraurora.crescent.util.SeiIterables;

public class Tuple3<T1, T2, T3> extends AbstractTuple implements ITuple{

    private final static int SIZE = 3;

    private Tuple3(Object[] values){
        super(values);
    }

    public static <T1, T2, T3> Tuple3<T1, T2, T3> of(T1 t1, T2 t2, T3 t3){
        Object[] objects = {t1, t2, t3};
        return new Tuple3<>(objects);
    }

    static <T1, T2, T3> Tuple3<T1, T2, T3> of(Iterable<?> iterable){
        Object[] obj = SeiIterables.toArray(iterable, SIZE);
        return new Tuple3<>(obj);
    }

}
